<?php
session_start();

if (!isset($_SESSION['username']) || !$_SESSION['username'] || time() - $_SESSION['lastaction'] > 600) 
{
	unset($_SESSION['username']);
	session_unset();
	session_destroy();
	header('Location:index.php');
	exit();
}

$_SESSION['lastaction'] = time();
?>